.class public Lrexsee/security/RexseeDigest;
.super Ljava/lang/Object;
.source "RexseeDigest.java"

# interfaces
.implements Lrexsee/core/browser/clazz/JavascriptInterface;


# static fields
.field private static final INTERFACE_NAME:Ljava/lang/String; = "Digest"


# instance fields
.field private final mBrowser:Lrexsee/core/browser/Browser;


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;)V
    .locals 0
    .param p1, "browser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 32
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 33
    iput-object p1, p0, Lrexsee/security/RexseeDigest;->mBrowser:Lrexsee/core/browser/Browser;

    .line 34
    return-void
.end method

.method private get_(Ljava/lang/String;Ljava/lang/String;ZZZ)Ljava/lang/String;
    .locals 5
    .param p1, "algorithm"    # Ljava/lang/String;
    .param p2, "string"    # Ljava/lang/String;
    .param p3, "isFile"    # Z
    .param p4, "showProgress"    # Z
    .param p5, "cancelable"    # Z

    .prologue
    .line 37
    if-eqz p3, :cond_0

    invoke-static {p2}, Lrexsee/core/utilities/Utilities;->getContent(Ljava/lang/String;)[B

    move-result-object v2

    move-object v0, v2

    .line 38
    .local v0, "bytes":[B
    :goto_0
    if-nez v0, :cond_1

    const-string v2, "[Exception]Error on reading source data."

    .line 56
    :goto_1
    return-object v2

    .line 37
    .end local v0    # "bytes":[B
    :cond_0
    invoke-virtual {p2}, Ljava/lang/String;->getBytes()[B

    move-result-object v2

    move-object v0, v2

    goto :goto_0

    .line 39
    .restart local v0    # "bytes":[B
    :cond_1
    new-instance v1, Lrexsee/security/RexseeDigest$1;

    invoke-direct {v1, p0, p1, v0}, Lrexsee/security/RexseeDigest$1;-><init>(Lrexsee/security/RexseeDigest;Ljava/lang/String;[B)V

    .line 53
    .local v1, "runnable":Lrexsee/core/browser/clazz/SyncTask$StringRunnable;
    if-eqz p4, :cond_2

    .line 54
    new-instance v2, Lrexsee/core/browser/clazz/SyncTask;

    invoke-direct {v2}, Lrexsee/core/browser/clazz/SyncTask;-><init>()V

    iget-object v3, p0, Lrexsee/security/RexseeDigest;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {v2, v1, v3, p5}, Lrexsee/core/browser/clazz/SyncTask;->run(Lrexsee/core/browser/clazz/SyncTask$StringRunnable;Lrexsee/core/browser/Browser;Z)Ljava/lang/String;

    move-result-object v2

    goto :goto_1

    .line 56
    :cond_2
    new-instance v2, Lrexsee/core/browser/clazz/SyncTask;

    invoke-direct {v2}, Lrexsee/core/browser/clazz/SyncTask;-><init>()V

    const/4 v3, 0x0

    const/4 v4, 0x0

    invoke-virtual {v2, v1, v3, v4}, Lrexsee/core/browser/clazz/SyncTask;->run(Lrexsee/core/browser/clazz/SyncTask$StringRunnable;Lrexsee/core/browser/Browser;Z)Ljava/lang/String;

    move-result-object v2

    goto :goto_1
.end method


# virtual methods
.method public get(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    .locals 6
    .param p1, "algorithm"    # Ljava/lang/String;
    .param p2, "string"    # Ljava/lang/String;

    .prologue
    const/4 v3, 0x0

    .line 65
    move-object v0, p0

    move-object v1, p1

    move-object v2, p2

    move v4, v3

    move v5, v3

    invoke-direct/range {v0 .. v5}, Lrexsee/security/RexseeDigest;->get_(Ljava/lang/String;Ljava/lang/String;ZZZ)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public get(Ljava/lang/String;Ljava/lang/String;ZZZ)Ljava/lang/String;
    .locals 1
    .param p1, "algorithm"    # Ljava/lang/String;
    .param p2, "string"    # Ljava/lang/String;
    .param p3, "isFile"    # Z
    .param p4, "showProgress"    # Z
    .param p5, "cancelable"    # Z

    .prologue
    .line 68
    invoke-direct/range {p0 .. p5}, Lrexsee/security/RexseeDigest;->get_(Ljava/lang/String;Ljava/lang/String;ZZZ)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getAlgorithms()Ljava/lang/String;
    .locals 1

    .prologue
    .line 62
    const-string v0, "MessageDigest"

    invoke-static {v0}, Ljava/security/Security;->getAlgorithms(Ljava/lang/String;)Ljava/util/Set;

    move-result-object v0

    invoke-static {v0}, Lrexsee/core/utilities/Json;->toJson(Ljava/util/Set;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getInheritInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 0
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 23
    return-object p0
.end method

.method public getInterfaceName()Ljava/lang/String;
    .locals 2

    .prologue
    .line 19
    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v1, p0, Lrexsee/security/RexseeDigest;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v1, v1, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v1, v1, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "Digest"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getNewInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 1
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 27
    new-instance v0, Lrexsee/security/RexseeDigest;

    invoke-direct {v0, p1}, Lrexsee/security/RexseeDigest;-><init>(Lrexsee/core/browser/Browser;)V

    return-object v0
.end method
